import tornado.httpserver
import tornado.ioloop
import tornado.options

import sys

from application import application

from tornado.options import define, options
define("port", default=8888, help="run on th given port", type=int)


def main():
    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)
    print("Development server is running at http://127.0.0.1:%s/" % options.port)
    print("Quit server with Control-C")
    tornado.ioloop.IOLoop.current().start()


if __name__ == "__main__":
    main()
